package QQclient;

import QQcommon.Message;

import java.io.ObjectInputStream;
import java.net.Socket;

public class ClientThread {
    public ClientThread(Socket socket) {
    }

    public void start() {
    }


    public class clientThread extends Thread{
        private Socket socket;

        public clientThread(Socket socket) {
            this.socket = socket;
        }

        @Override
        public void run() {
            while (true) {
                try {
                    ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
                    System.out.println("等待从服务端读取数据");
                    Message mes = (Message) ois.readObject();//如果一直接收不到，会一直堵在这里
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        public Socket getSocket() {
            return socket;
        }
    }

}
